package com.siyougame.business.dal.mysql.inspectItemImg;

import java.util.*;

import com.siyougame.common.pojo.PageResult;
import com.siyougame.mybatis.mybatis.core.query.LambdaQueryWrapperX;
import com.siyougame.mybatis.mybatis.core.mapper.BaseMapperX;
import com.siyougame.business.dal.dataobject.inspectItemImg.InspectItemImgDO;
import org.apache.ibatis.annotations.Mapper;
import com.siyougame.business.controller.admin.inspectItemImg.vo.*;

/**
 * 检查记录明细附件 Mapper
 *
 * @author ${table.author}
 */
@Mapper
public interface InspectItemImgMapper extends BaseMapperX<InspectItemImgDO> {

    default PageResult<InspectItemImgDO> selectPage(InspectItemImgPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InspectItemImgDO>()
                .eqIfPresent(InspectItemImgDO::getInspectId, reqVO.getInspectId())
                .eqIfPresent(InspectItemImgDO::getInspectItemId, reqVO.getInspectItemId())
                .eqIfPresent(InspectItemImgDO::getImgUrl, reqVO.getImgUrl())
                .eqIfPresent(InspectItemImgDO::getStatus, reqVO.getStatus())
                .eqIfPresent(InspectItemImgDO::getRemark, reqVO.getRemark())
                .eqIfPresent(InspectItemImgDO::getSortRank, reqVO.getSortRank())
                .eqIfPresent(InspectItemImgDO::getDescription, reqVO.getDescription())
                .betweenIfPresent(InspectItemImgDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(InspectItemImgDO::getId));
    }

    default List<InspectItemImgDO> selectList(InspectItemImgExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<InspectItemImgDO>()
                .eqIfPresent(InspectItemImgDO::getInspectId, reqVO.getInspectId())
                .eqIfPresent(InspectItemImgDO::getInspectItemId, reqVO.getInspectItemId())
                .eqIfPresent(InspectItemImgDO::getImgUrl, reqVO.getImgUrl())
                .eqIfPresent(InspectItemImgDO::getStatus, reqVO.getStatus())
                .eqIfPresent(InspectItemImgDO::getRemark, reqVO.getRemark())
                .eqIfPresent(InspectItemImgDO::getSortRank, reqVO.getSortRank())
                .eqIfPresent(InspectItemImgDO::getDescription, reqVO.getDescription())
                .betweenIfPresent(InspectItemImgDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(InspectItemImgDO::getId));
    }

}